<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/23
  Time: 19:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
  <head>
    <base href="<%=basePath%>">
      <link href="css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print"/>
      <link href="css/print.css" rel="stylesheet" type="text/css" media="print"/>
      <script src="js/jquery-1.10.1.min.js"></script>
      <script src="js/side.js" type="text/javascript"></script>
      <script>
          function Update_Bulletin(e){
              var formObject = {};
              var formArray =$("#form2").serializeArray();
              $.each(formArray,function(i,item){
                  formObject[item.name] = item.value;
              });
              $.ajax({
                  url:'bulletin/Update_Bulletin',
                  headers: {
                      'Content-Type': 'application/json;charset=utf-8',
                  },
                  type:'POST',
                  data:JSON.stringify(formObject),
                  dataType: "json",
                  success: function (data) {
                      if (data.code == '1000') {
                          console.log(data.message);
                          alert("修改失败");
                      } else if (data.code == '1001') {
                          console.log(data.message);
                          alert("修改成功");
                          window.location.href='bulletin/all_bulletin';
                      }else if (data.code == '1002') {
                          alert("没有修改任何数据");
                          window.location.href='bulletin/all_bulletin';
                      }
                  }
              })
          }
      </script>
  </head>
  <body>
 <%
   String title=request.getParameter("title");
   String content=request.getParameter("content");
   String status = request.getParameter("status");
   String id = request.getParameter("id");
 %>
 <form id="form2">
     <div id="Popup">
         <div id="SubPopup">
             <div class="form_boxC">
                 <p>"<span class="f_cB">*</span>"号为不可修改项目</p>
                 <table cellpadding="0" cellspacing="0">
                     <tr>
                         <th width="100">编号 <span class="f_cB">*</span></th>
                         <td>
                             <div class="txtbox floatL" style="width:150px;">
                                 <input name="id" type="text" size="5" value=<%=id%> readonly>
                             </div>
                         </td>
                     </tr>
                     <tr>
                         <th>标题 <span class="f_cB"></span></th>
                         <td>
                             <div class="txtbox floatL" style="width: 666px;height: 50px;text-align: center;">
                                 <input style="width: 666px;height: 100%;word-break: break-all;" name="title" type="text" size="20" value=<%=title%>>
                             </div>
                         </td>
                     </tr>
                     <tr>
                         <th>内容 <span class="f_cB"></span></th>
                         <td>
                             <div class="txtbox floatL" style="width: 666px;height: 300px;">
                                 <textarea cols="40" style="width: 666px;height: 100%;" name="content"><%=content%></textarea>
                             </div>
                         </td>
                     </tr>
                     <tr>
                         <th>状态 <span class="f_cB"></span></th>
                         <td>
                             <div class="txtbox floatL" style="width:100px;">
                                 <input name="status" type="text" size="6" value=<%=status%>  placeholder="有效/无效">
                             </div>
                         </td>
                     </tr>
                 </table>
             </div>
             <div id="BtmBtn">
                 <div class="btn_boxB floatR mag_l20">
                     <button style="cursor: pointer;background-color: #36c4aa;color: white;padding: 12px 20px;display: inline-block;font-size: 15px;" type="submit" onclick="Update_Bulletin()">确定</button>
                 </div>
                 <div class="btn_box floatR">
                     <button style="cursor: pointer;background-color: #36c4aa;color: white;padding: 12px 20px;display: inline-block;font-size: 15px;"><a style="color: white; text-decoration:none;" href="bulletin/all_bulletin">返回</a></button>
                 </div>
             </div>
         </div>
     </div>
 </form>


  </body>
</html>
